﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_webcon_student : System.Web.UI.UserControl
{

    public int Guid
    {
        set
        {
            this.hlName.Attributes.Add("Guid", value.ToString());
            Student stu = new Student(value);
            this.hlName.NavigateUrl = Params.AdminFolderHttp + "student.aspx?guid=" + value.ToString();
            this.hlName.Text = stu.RealName;
            this.labPaper.Text = stu.PaperFlag == 0 ? "否" : "是";
            this.labEmail.Text = stu.Email;
            this.labID.Text = stu.UserID;
            this.hlDoctor.Text = stu.DoctorName;
            this.hlExpert.Text = stu.ExpertName;
            this.hlDoctor.NavigateUrl = Params.AdminFolderHttp + "doctor.aspx?guid=" + stu.DoctorGuid.ToString();
            this.lbDel.Attributes.Add("onclick", "return confirm('确定删除该学生，以及相关信息？')");
            if (stu.ExpertGuid != 0)
            {
                this.hlExpert.NavigateUrl = Params.AdminFolderHttp + "doctor.aspx?guid=" + stu.ExpertGuid.ToString();
            }
            else
            {
                this.hlExpert.NavigateUrl = "";
            }
        }
        get
        {
            return Convert.ToInt32(this.hlName.Attributes["Guid"]);
        }
    }

    public int SortID
    {
        set
        {
            this.labSortID.Text = value.ToString();
        }
    }
    protected void lbDel_Click(object sender, EventArgs e)
    {
        Student.Delete(this.Guid);
        Fun.Refresh("删除成功");
    }
}
